//
//  ocFile.m
//  AlterationSwitch
//
//  Created by solarke_apple_mini_1 on 2018/10/23.
//  Copyright © 2018年 石家庄科林电气股份有限公司. All rights reserved.
//

#import "ocFile.h"
#import "native.hpp"
#import <iostream>
#import "AlterationSwitch_bridge.h"

@implementation ocFile

- (int)get_framelen:(unsigned char *)buf{
    return nativeCC::get_framelen(buf);
}

- (int)get_datalen:(unsigned char *)buf {
    return nativeCC::get_datalen(buf);
}

- (unsigned char *)ctrl_fn003_send:(unsigned char *)termaddr A3:(unsigned char)A3 mpNo:(int)mpNo fromphase:(unsigned char)fromphase tophase:(unsigned char)tophase {
    return nativeCC::ctrl_fn003_send(termaddr, A3, mpNo, fromphase, tophase);
}

- (unsigned char *)askOneData_fn15_send:(unsigned char *)termaddr A3:(unsigned char)A3 {
    return nativeCC::askOneData_fn15_send(termaddr, A3);
}

- (unsigned char *)askOneData_fn179_send:(unsigned char *)termaddr A3:(unsigned char)A3 {
    return nativeCC::askOneData_fn179_send(termaddr, A3);
}

- (unsigned char *)askOneData_fn181_send:(unsigned char *)termaddr A3:(unsigned char)A3 mpNo:(int)mpNo {
    return nativeCC::askOneData_fn181_send(termaddr, A3, mpNo);
}

- (unsigned char *)askTwoData_fn239_send:(unsigned char *)termaddr A3:(unsigned char)A3 mpNo:(int)mpNo year:(int)year month:(unsigned char)month day:(unsigned char)day {
    return nativeCC::askTwoData_fn239_send(termaddr, A3, mpNo, year, month, day);
}

- (unsigned char *)askTwoData_fn240_send:(unsigned char *)termaddr A3:(unsigned char)A3 mpNo:(int)mpNo year:(int)year month:(unsigned char)month {
    return nativeCC::askTwoData_fn240_send(termaddr, A3, mpNo, year, month);
}

- (char *)askOneData_fn15_recv:(unsigned char *)frame {
    return nativeCC::askOneData_fn15_recv(frame);
}

- (char *)askOneData_fn179_recv:(unsigned char *)frame {
    return nativeCC::askOneData_fn179_recv(frame);
}

- (char *)askOneData_fn181_recv:(unsigned char *)frame {
    return nativeCC::askOneData_fn181_recv(frame);
}

- (char *)askTwoData_fn239_recv:(unsigned char *)frame {
    return nativeCC::askTwoData_fn239_recv(frame);
}

- (char *)askTwoData_fn240_recv:(unsigned char *)frame {
    return nativeCC::askTwoData_fn240_recv(frame);
}

- (NSString *)parse_recv_frame:(unsigned char *)frame {
    char *parseRecv = nativeCC::parse_recv_frame(frame);
    NSString *string_content = [[NSString alloc] initWithCString:parseRecv encoding:NSASCIIStringEncoding];
    return string_content;
                                 
}

@end
